Class: Cranium::DSL::ExtractDefinition
- Inherits:
-
Object
- Object
- Cranium::DSL::ExtractDefinition
- Extended by:
- AttributeDSL
- Defined in:
- lib/cranium/dsl/extract_definition.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
-
#initialize(name) ⇒ ExtractDefinition
constructor
A new instance of ExtractDefinition.
- #last_extracted_value_of(field, default = nil) ⇒ Object
Methods included from AttributeDSL
define_array_attribute, define_attribute, define_boolean_attribute
Constructor Details
#initialize(name) ⇒ ExtractDefinition
Returns a new instance of ExtractDefinition.
16 17 18 19 |
# File 'lib/cranium/dsl/extract_definition.rb', line 16 def initialize(name) @name = name @storage = Cranium::Extract::Storage.new name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cranium/dsl/extract_definition.rb', line 7 def name @name end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
7 8 9 |
# File 'lib/cranium/dsl/extract_definition.rb', line 7 def storage @storage end |
Instance Method Details
#last_extracted_value_of(field, default = nil) ⇒ Object
23 24 25 26 |
# File 'lib/cranium/dsl/extract_definition.rb', line 23 def last_extracted_value_of(field, default = nil) stored_value = @storage.last_value_of field stored_value.nil? ? default : stored_value end |