<commit_before># spira-timestamps

spira-timestamps adds automatic timestamps to your Spira models.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'spira-timestamps'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install spira-timestamps

## Usage

spira-timestamps adds `created` and `updated` `DateTime` attributes to
your model with the Dublin Core
[`created`](http://purl.org/dc/terms/created) and
[`modified`](http://purl.org/dc/terms/modified) predicates.

To add timestamps to a model, just add `include Spira::Timestamps` to
your model class.

For example:
```ruby
class Person < Spira::Base
  include Spira::Timestamps

  property :name, predicate: FOAF.name, type: String
end
```

Timestamps are updated automatically when you `save` your model.

You can access the timestamps either as `DateTime` objects via the
`created_at` and `updated_at` properties or as `Date` objects via the
`created_on` and `updated_on` properties. For example:

    > bob = Person.new(name: 'Bob').save
    => <Person:2170778720 @subject: _:g2170778680> 
    > bob.created_at
    => #<DateTime: 2014-12-08T20:48:27+11:00 ...>
    > bob.created_on
    => #<Date: 2014-12-08 ...>
    > bob.touch
    => <Person:2170778720 @subject: _:g2170778680> 
    > bob.updated_at
    => #<DateTime: 2014-12-08T20:49:41+11:00 ...>
    > bob.updated_on
    => #<Date: 2014-12-08 ...>

## Contributing

1. Fork it ( https://github.com/nhurden/spira-timestamps/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request<commit_msg>Feature branches should be namespaced<commit_after># spira-timestamps

spira-timestamps adds automatic timestamps to your Spira models.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'spira-timestamps'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install spira-timestamps

## Usage

spira-timestamps adds `created` and `updated` `DateTime` attributes to
your model with the Dublin Core
[`created`](http://purl.org/dc/terms/created) and
[`modified`](http://purl.org/dc/terms/modified) predicates.

To add timestamps to a model, just add `include Spira::Timestamps` to
your model class.

For example:
```ruby
class Person < Spira::Base
  include Spira::Timestamps

  property :name, predicate: FOAF.name, type: String
end
```

Timestamps are updated automatically when you `save` your model.

You can access the timestamps either as `DateTime` objects via the
`created_at` and `updated_at` properties or as `Date` objects via the
`created_on` and `updated_on` properties. For example:

    > bob = Person.new(name: 'Bob').save
    => <Person:2170778720 @subject: _:g2170778680> 
    > bob.created_at
    => #<DateTime: 2014-12-08T20:48:27+11:00 ...>
    > bob.created_on
    => #<Date: 2014-12-08 ...>
    > bob.touch
    => <Person:2170778720 @subject: _:g2170778680> 
    > bob.updated_at
    => #<DateTime: 2014-12-08T20:49:41+11:00 ...>
    > bob.updated_on
    => #<Date: 2014-12-08 ...>

## Contributing

1. Fork it ( https://github.com/nhurden/spira-timestamps/fork )
2. Create your feature branch (`git checkout -b feature/my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
{'fraction_non_alphanumeric': 0.13047235023041476, 'fraction_numerical': 0.05587557603686636, 'mean_word_length': 3.891549295774648, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 39, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7498678', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1171, 'n_words': 359}