Class: NPR::Entity::Crop

Inherits:
Base
  • Object
show all
Defined in:
lib/npr/entity/crop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concern::ShallowAttributes

included

Methods included from Concern::Relation

included

Constructor Details

#initialize(json) ⇒ Crop




11
12
13
14
15
16
# File 'lib/npr/entity/crop.rb', line 11

def initialize(json)
  @type   = json["type"]
  @src    = json["src"]
  @width  = json["width"].to_i
  @height = json["height"].to_i
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



7
8
9
# File 'lib/npr/entity/crop.rb', line 7

def height
  @height
end

#srcObject

Returns the value of attribute src.



7
8
9
# File 'lib/npr/entity/crop.rb', line 7

def src
  @src
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/npr/entity/crop.rb', line 7

def type
  @type
end

#widthObject

Returns the value of attribute width.



7
8
9
# File 'lib/npr/entity/crop.rb', line 7

def width
  @width
end